package pojo.dao;

import org.apache.ibatis.session.SqlSessionFactory;

import pojo.bean.Course;
import pojo.mapper.CourseMapper;

public class CourseDAO extends AbstractMapperDAO implements CourseMapper {
    private CourseMapper mapper;

    public CourseDAO(SqlSessionFactory factory) {
        super(factory);
        mapper = session.getMapper(CourseMapper.class);
    }

    @Override
    public int deleteByPrimaryKey(int courseId) {
        // TODO 自动生成的方法存根
        return 0;
    }

    @Override
    public int insert(Course record) {
        // TODO 自动生成的方法存根
        return 0;
    }

    @Override
    public int insertSelective(Course record) {
        // TODO 自动生成的方法存根
        return 0;
    }

    @Override
    public Course selectByPrimaryKey(int courseId) {
        // TODO 自动生成的方法存根
        return null;
    }

    @Override
    public Course selectByForeignKeys(Course temporary) {
        Course course;
        try {
            course = mapper.selectByForeignKeys(temporary);
        } catch (Exception e) {
            course = null;
            e.printStackTrace();
        }
        return course;
    }

    @Override
    public int updateByPrimaryKeySelective(Course record) {
        // TODO 自动生成的方法存根
        return 0;
    }

    @Override
    public int updateByPrimaryKey(Course record) {
        // TODO 自动生成的方法存根
        return 0;
    }

}
